import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// 导入echarts插件 
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts;


import { MessageBox, Select, Option, Pagination, Table, TableColumn, Breadcrumb, BreadcrumbItem, RadioGroup, RadioButton, Row, Col, Menu, MenuItem, MenuItemGroup, Submenu, Message, Dialog, Link, Form, FormItem, Input, Button } from 'element-ui'
Vue.use(Form)
Vue.use(Pagination)
Vue.use(Select)
Vue.use(Option)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(RadioGroup)
Vue.use(RadioButton)
Vue.use(Row)
Vue.use(Col)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Dialog)
Vue.use(Link)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Button)
Vue.prototype.$message = Message;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;

import './assets/reset.css'
Vue.config.productionTip = false
Vue.prototype.$bus = new Vue({});
// 全局路由守卫
router.beforeEach((to, from, next) => {
    if (to.name == "Login") {
        store.commit("changeFlag", false)
    } else {
        store.commit("changeFlag", true)
    }
    next();
})
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')